"use strict";

/**
 * @auther wtfssd
 * Created by wtfssd on 2017/12/4
 */
import * as React from 'react'

const {View, ScrollView} = require('react-native');
const {connect} = require('react-redux');
import {commonProps, commonStyles} from "../../assets/styles/common";
import NavBackButton from "../../component/BackButton";
import Colors from "../../assets/styles/Colors";

const NavigationBar = require('react-native-navbar').default;
const {Actions} = require("react-native-router-flux");
const {List, Switch} = require('antd-mobile');

class ConfigNoticePage extends React.Component<any, any> {

    constructor(props: any, context: any) {
        super(props, context);
        this.state = {
            notice: false,
            mail: false,
        }
    }

    onChange = (f, v) => {
        let obj = {};
        obj[f] = v;
        this.setState({...obj})
    };

    render() {
        return (
            <View style={[commonStyles.container]}>
                <NavigationBar {...commonProps.navBar}
                               leftButton={<NavBackButton/>}
                               title={{title: '配置通知', tintColor: Colors.White}}
                />
                <ScrollView>
                    <List>
                        <List.Item
                            extra={<Switch checked={this.state.notice} onChange={this.onChange.bind(this, 'notice')}/>}>信息</List.Item>
                        <List.Item extra={<Switch checked={this.state.mail}
                                                  onChange={this.onChange.bind(this, 'mail')}/>}>邮件</List.Item>
                    </List>
                </ScrollView>
            </View>
        );
    }
}


export default ConfigNoticePage;